/**
 * 
 */
package org.openarchitectureware.recipe2.findbugs;

import java.lang.annotation.ElementType;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import edu.umd.cs.findbugs.ba.XClass;
import edu.umd.cs.findbugs.ba.XField;
import edu.umd.cs.findbugs.ba.XMethod;
import edu.umd.cs.findbugs.classfile.ClassDescriptor;
import edu.umd.cs.findbugs.classfile.DescriptorFactory;
import edu.umd.cs.findbugs.classfile.MethodDescriptor;
import edu.umd.cs.findbugs.classfile.analysis.AnnotatedObject;
import edu.umd.cs.findbugs.classfile.analysis.AnnotationValue;

public class NonExistingClass implements XClass {
	private final ClassDescriptor classDescriptor;

	public NonExistingClass(ClassDescriptor classDescriptor) {
		this.classDescriptor = classDescriptor;
	}

	public NonExistingClass(String className) {
		this.classDescriptor = DescriptorFactory.createClassDescriptorFromDottedClassName(className);
	}

	public XField findField(String name, String signature, boolean isStatic) {
		return null;
	}

	public XMethod findMatchingMethod(MethodDescriptor descriptor) {
		return null;
	}

	public XMethod findMethod(String methodName, String methodSig, boolean isStatic) {
		return null;
	}

	public XMethod findMethod(MethodDescriptor descriptor) {
		return null;
	}

	public AnnotationValue getAnnotation(ClassDescriptor desc) {
		return null;
	}

	public Collection<ClassDescriptor> getAnnotationDescriptors() {
		return Collections.emptyList();
	}

	public ClassDescriptor getImmediateEnclosingClass() {
		return null;
	}

	public ClassDescriptor[] getInterfaceDescriptorList() {
		return new ClassDescriptor[0];
	}

	public String getSource() {
		return ".";
	}

	public String getSourceSignature() {
		return null;
	}

	public ClassDescriptor getSuperclassDescriptor() {
		return null;
	}

	public List<? extends XField> getXFields() {
		return Collections.emptyList();
	}

	public List<? extends XMethod> getXMethods() {
		return Collections.emptyList();
	}

	public boolean hasStubs() {
		return false;
	}

	public boolean isAbstract() {
		return false;
	}

	public boolean isInterface() {
		return false;
	}

	public boolean usesConcurrency() {
		return false;
	}

	public int compareTo(ClassDescriptor o) {
		return o.compareTo(classDescriptor);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((classDescriptor == null) ? 0 : classDescriptor.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		NonExistingClass other = (NonExistingClass) obj;
		if (classDescriptor == null) {
			if (other.classDescriptor != null)
				return false;
		} else if (!classDescriptor.equals(other.classDescriptor))
			return false;
		return true;
	}

	public int getAccessFlags() {
		return 0;
	}

	public ClassDescriptor getClassDescriptor() {
		return classDescriptor;
	}

	public boolean isDeprecated() {
		return false;
	}

	public boolean isFinal() {
		return false;
	}

	public boolean isPrivate() {
		return false;
	}

	public boolean isProtected() {
		return false;
	}

	public boolean isPublic() {
		return false;
	}

	public boolean isStatic() {
		return false;
	}

	public boolean isSynthetic() {
		return false;
	}

	public Collection<AnnotationValue> getAnnotations() {
		return Collections.emptyList();
	}

	public AnnotatedObject getContainingScope() {
		return null;
	}

	public ElementType getElementType() {
		return ElementType.TYPE;
	}
}